package base;

import android.os.Bundle;
import android.widget.ImageView;


import androidx.appcompat.app.AppCompatActivity;

import io.flutter.embedding.android.FlutterActivity;
import utils.GlideUtils;
import utils.ToastUtils;


/**
 * Created by My on 2017/10/10.
 */

public class BaseActivity extends AppCompatActivity {

    public void createToast(final String paramString) {
        ToastUtils.showToast(getBaseContext(),paramString);
    }

    @Override
    protected void onPause() {
        super.onPause();
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);

    }
    @Override
    public boolean moveTaskToBack(boolean nonRoot) {
        return super.moveTaskToBack(true);
    }
    /**
     * 显示图片
     *
     * @param view
     * @param strHttpUrl
     */
    public void display(ImageView view, String strHttpUrl) {
        GlideUtils.loadImageView(this.getApplication(),strHttpUrl,view);
    }

    /**
     * @param view
     * @param strHttpUrl
     * @param loadingResId 加载中与加载失败为同一张图片
     */
    public void display(ImageView view, String strHttpUrl, int loadingResId) {
        GlideUtils.loadImageViewLoding(this.getApplication(),strHttpUrl,view,loadingResId,loadingResId);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

}
